export default {
	data() {
		return {

		}
	},
	filters: {},
	methods: {
		getLocalizedValue(item, fieldName) {
			const fieldMapping = {
				'zh-Hans': {
					name: 'name',
					title: 'title',
					text: 'text',
					content: 'content',
					article_title: 'article_title',
					placeholder: 'placeholder',
					article_content: 'article_content',
					product_name: 'product_name',
					selling_point: 'selling_point',
					group_name: 'group_name',
					spec_value: 'spec_value',
					value: 'value',
					grade_name: 'grade_name'
				},
				'en': {
					name: 'name_eng',
					title: 'title_eng',
					text: 'text_eng',
					content: 'content_eng',
					article_title: 'article_title_eng',
					placeholder: 'placeholder_end',
					article_content: 'article_content_eng',
					product_name: 'product_name_eng',
					selling_point: 'selling_point_eng',
					group_name: 'group_name_eng',
					spec_value: 'spec_value_eng',
					value: 'value_eng',
					grade_name: 'grade_name_eng'
				}
			};
			const lang = this.$i18n.locale; // 获取当前语言
			const fieldMap = fieldMapping[lang] || fieldMapping['zh']; // 默认回退到中文
			const mappedFieldName = fieldMap[fieldName];
			return item[mappedFieldName] != undefined ? item[mappedFieldName] : item[fieldName];
		}
	}
}